{include file="header.tpl"} {include file="selectArea.tpl"} {block name=body}
	<script>
	$(document).ready(function() {
		//To display the selected area
	 	 var selectedAreaName = sessionStorage.getItem("selectedAreaName");
	     document.getElementById("popId").text=selectedAreaName;
	   	//To display Login UserName
	     var selectedUserName = sessionStorage.getItem("selectedUserName");
	     document.getElementById("userNm").text=selectedUserName;
	});
	</script>
    <style>
    p{
    font-size:15px; font-family:arial;
    }
    </style>
	<table style="margin-top:30px; margin-bottom:30px; border-collapse:collapse; width: 900px; margin-left:12%;">
			{foreach $items as $item}
				{if $item.item_category_id eq $catvar}
				{foreach $shop as $category}
					{if $item.item_category_id eq $category.category_id}
					<tr style="border-bottom:1px solid #ccc;">
						<td height="200px" width="200px">
						<!-- Below code is to retrieve the Blob image from the database -->
						<a href="/Project001/phpFiles/index.php?item={$item.item_id}&cook1={$cookieValDisp}">
						<img src="data:image/jpeg;base64,{base64_encode($item.item_image)}" style="border: 1px solid #ccc; margin: 10px;" height="150px" width="150px">
						</a>
						</td>
					
						<td height="200px" width="200px" style="margin-left: 20px; float: left;">
						{foreach $companyList as $company}
						{if $company.company_id eq $item.item_company_id}
	        				<span>
	          				  <a style="margin-top:30px; display: block; font-family: arial; font-weight:bold; text-transform: uppercase; color: #999; font-size: 14px;" 
	          				  href="/Project001/phpFiles/index.php?item={$item.item_id}&cook1={$cookieValDisp}">{$company.company_name}</a>
	          				</span>		
	          			{/if}
						{/foreach}
						
							<span>
	           				<a style="display: inline-block; margin-bottom: 5px; font-family: arial; color: #999; font-size: 12px;"
	           				href="/Project001/phpFiles/index.php?item={$item.item_id}&cook1={$cookieValDisp}">{$item.item_name}</a>
	           				</span>		
						</td>
					
						<td height="200px" width="200px">
							<p>{$item.item_description}</p>
						</td>
					
						{if $cookieValDisp=="wholesale"}
						{foreach $wholesaleList as $wholeVal}
						{if $wholeVal.item_id eq $item.item_id}
							<td height="200px" width="200px">
								<p>{$wholeVal.wholesale_price}</p>
							</td>
						{/if}
							<td height="200px" width="200px">
								<p>{$wholeVal.whole_item_quantity}</p>
							</td>
						{/foreach}
						{else}
						<td height="200px" width="200px">
							<p>{$item.item_retail_price}</p>
						</td>
						{/if}
						
						<td height="200px" width="200px">
							<form action="/Project001/phpFiles/cart.php">
								<input onmouseover="this.style.backgroundColor='#F0F0F0'" onmouseout="this.style.backgroundColor=''" 
								style="color:grey;" class="button silverbtn" type="submit" name="submit" value="Add to Cart">
							</form>
						</td>
					</tr>
					{/if}
				{/foreach}
				{/if}
			{/foreach}
	</table>
{/block} 
{include file="footer.tpl"}
